﻿namespace Wicresoft.Busi.BizLogic
{
    using System;
    using System.Web.UI.WebControls;

    public class DDLCommon
    {
        public static bool SetText(DropDownList ddl, string text)
        {
            int index = ddl.Items.IndexOf(ddl.Items.FindByText(text));
            if (index < 0)
            {
                return false;
            }
            ddl.SelectedIndex = index;
            return true;
        }

        public static bool SetValue(DropDownList ddl, string Value)
        {
            int index = ddl.Items.IndexOf(ddl.Items.FindByValue(Value));
            if (index < 0)
            {
                return false;
            }
            ddl.SelectedIndex = index;
            return true;
        }
    }
}

